var a = require("../../utils/systemInfo"); 
var r = 0;
Component({
  properties: {
    title: { //头部标题
      type: String,
      value: ""
    },
    userInfo: {  //用户信息
      type: Object,
      value: {
        userInfo: ""
      }
    },
    useCover: {
      type: Boolean,
      value: false
    },
    onlyBack: {
      type: Boolean,
      value: false
    },
    cardName: String,
    fontColor: {//字体颜色
      type: String,
      value: "#000"
    },
    backgroundColor: {//背景颜色
      type: String,
      value: "#fff"
    },
    replaceBack: {
      type: Boolean,
      value: false
    },
    show: {
      type: Boolean,
      value: true
    },
    showPlaceholder: {
      type: Boolean,
      value: true
    }
  },
  data: {
    avatarUrl: "",
    isShowBack: true,
    showBackBtn: false,
    defaultlogo: "",
    showUserAvatar: false,
    statusBarHeight: 0,
    msgTip: false
  },
  ready: function () { },
  lifetimes: {
    attached: function () {
      this.setStatusBarHeight()
    }
  },
  methods: {
    setStatusBarHeight: function () {
      this.setData({
        statusBarHeight: a.systemInfo.statusBarHeight
      });
    },
    handleGoBack: function () {
      this.data.replaceBack ? this.triggerEvent("back") : wx.navigateBack();
    },
    // handleGoHome: function () {
    //   var e = "/pages/usercenter/usercenter";
    //   n.globalData.isStoreType ? wx.switchTab({
    //     url: e
    //   }) : wx.navigateTo({
    //     url: e
    //   });
    // },
    handleTitleTouchStart: function () {
      // r = Date.now();
    },
    handleTitleTouchEnd: function () {
      // var e = Date.now() - r;
      // e > 1e4 && e < 6e4 && (0, t.setLogToClipboard)();
    },
    // submit: function (e) {
    //   this.triggerEvent("submit", {
    //     formId: e.detail.formId
    //   });
    // },
    showWatchCard: function () {
      this.triggerEvent("showWatchCard");
    }
  }
});